(function(){"use strict";BX.namespace("BX.Landing.OnscrollAnimationHelper");if(BX.browser.IsMobile()){return}BX.Landing.OnscrollAnimationHelper.observer=new IntersectionObserver(c);BX.Landing.OnscrollAnimationHelper.animatedMap=new WeakMap;var n=BX.Landing.Utils.addClass;var i=BX.Landing.Utils.removeClass;var e=BX.Landing.Utils.hasClass;var a=BX.Landing.Utils.style;var t=BX.Landing.Utils.isPlainObject;var o=BX.Type.isArray;var r=BX.Landing.Utils.onAnimationEnd;var l=BX.Landing.Utils.slice;var d=BX.Landing.Utils.onCustomEvent;var s;d("BX.Landing.Block:init",(function(n){s=Date.now();if(BX.hasClass(n.block,"landing-designer-block-mode")){return}var i=BX.Landing.OnscrollAnimationHelper.getBlockAnimatedElements(n.block);i.forEach((function(n){m(n);BX.Landing.OnscrollAnimationHelper.observer.observe(n)}))}));d("BX.Landing.UI.Panel.URLList:show",(function(n){var i=BX.Landing.OnscrollAnimationHelper.getBlockAnimatedElements(n);i.forEach((function(n){m(n);BX.Landing.OnscrollAnimationHelper.observer.observe(n)}))}));d("BX.Landing.Block:updateStyle",(function(n){if(t(n.data)&&o(n.data.affect)&&o(n.node)){const i=n.data.affect.some((function(n){return n===BX.Landing.OnscrollAnimationHelper.PROP}));if(i){const i=BX.Landing.OnscrollAnimationHelper.getBlockAnimatedElements(n.block);i.forEach((i=>{if(n.node.indexOf(i)!==-1){BX.Landing.OnscrollAnimationHelper.animatedMap.delete(i);m(i);BX.Landing.OnscrollAnimationHelper.animateElement(i)}}))}}}));BX.Landing.OnscrollAnimationHelper.SELECTOR=".js-animation";BX.Landing.OnscrollAnimationHelper.PROP="animation-name";BX.Landing.OnscrollAnimationHelper.getBlockAnimatedElements=function(n){return l(n.querySelectorAll(BX.Landing.OnscrollAnimationHelper.SELECTOR))};function m(n){void a(n,{"animation-duration":"1000ms","animation-name":"none","animation-play-state":"paused"})}function c(n){n.forEach((function(n){if(n.isIntersecting){BX.Landing.OnscrollAnimationHelper.animateElement(n.target)}}))}BX.Landing.OnscrollAnimationHelper.animateElement=function(n){if(!BX.Landing.OnscrollAnimationHelper.animatedMap.has(n)){return g(n).then((function(){BX.Landing.OnscrollAnimationHelper.animatedMap.set(n,true);void a(n,{"animation-name":"none"});i(n,"animated");if(e(n,"modified")){i(n,"modified")}}))}return Promise.resolve()};function g(i){if(window.performance.timing.domContentLoadedEventStart-window.performance.timing.domLoading>400&&window.performance.timing.domComplete===0&&BX.Landing.getMode()!=="edit"){n(i,"modified")}n(i,"animated");void a(i,{"animation-name":"","animation-play-state":"running"});return r(i)}})();
//# sourceMappingURL=onscroll-animation_init.map.js